package vision;

import geometrie.Point2D;

import java.awt.Color;

public class ImageFacette implements Comparable<ImageFacette> {
	// A COMPLETER...
	private Point2D[] point = new Point2D[3];
	double altitude;

	public ImageFacette(Point2D[] point, double altitude){
		this.point = point;
		this.altitude = altitude;
	}
	public double getAltitude(){
		return altitude;
	}
	
	public int[] getXPoints(){
		int[] xIntPoints = new int[3];
		xIntPoints[0] = new Double(Math.round(point[0].getXCartesien())).intValue();
		xIntPoints[1]= new Double(Math.round(point[1].getXCartesien())).intValue();
		xIntPoints[2]= new Double(Math.round(point[2].getXCartesien())).intValue();
		return xIntPoints;
	}
	
	public int[] getYPoints(){
		int[] yIntPoints = new int[3];
		yIntPoints[0] = new Double(Math.round(point[0].getYCartesien())).intValue();
		yIntPoints[1]= new Double(Math.round(point[1].getYCartesien())).intValue();
		yIntPoints[2]= new Double(Math.round(point[2].getYCartesien())).intValue();
		return yIntPoints;
	}
	
	@Override
	public int compareTo(ImageFacette arg0) {
		return (int)(this.altitude - arg0.getAltitude());
	}
	
	public String toString(){
		return new String("P1: " + point[0] + ", P2: " + point[1] + ", P3: " + point[2] + ", H: " + altitude);
	}

}


